/**
 * index的方法
 * */


//判断码值
function qrEmpty(){
    if (code == undefined || code == '') {
        viewEmpty();
        return
    }
    $.ajax({
        type: apis.qrEmpty.method,
        url: domain + apis.qrEmpty.url,
        data: {code: code},
        success: function (res) {
            console.log(res);
            if (res.code != 0) {
                msgPop({msg: res.msg});
                return
            }
            if (res.data.view == '') {
                window.location.href = routes.scence + '?code=' + code;
            } else {
                window.location.href = res.data.view;
            }
        },
        error: function () {
            console.log('网络错误');
        }
    });
}


//空页面
function viewEmpty(){
    var h = '';
    h += '<div style="margin-top: 50%; width: ' + cw + 'px; height: ' + ch + 'px; text-align: center; color: #888;">';
    h += '啥也没有...';
    h += '</div>';
    $('body').html(h);
}